﻿Imports System.Data.OleDb
Public Class Dealrequest
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

        Dim sql As String = "INSERT INTO Dealrequest (Title,Description,Requestedby) VALUES (@f1,@f2,@f3)"
        Dim conn As OleDbConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings("DealsDbConnection").ConnectionString)
        Dim cmd As OleDbCommand = New OleDbCommand(sql, conn)
        cmd.Parameters.AddWithValue("@f1", tb_title.Text)
        cmd.Parameters.AddWithValue("@f2", tb_question.Text)
        cmd.Parameters.AddWithValue("@f3", User.Identity.Name)
        


        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()
        cmd.Dispose()
        conn.Dispose()
        Response.Redirect("Dealrequestlist.aspx")
    End Sub
End Class